home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 968 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: allocating unlimited string input....HELP
  5. Date: Wed, 10 Jan 96 14:45:23 GMT
  6. Organization: none
  7. Message-ID: <821285123snz@genesis.demon.co.uk>
  8. References: <4cvph6$s8s@pulp.ucs.ualberta.ca>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4cvph6$s8s@pulp.ucs.ualberta.ca>
  15.            ryangall@gpu.srv.ualberta.ca "Bobby Sixkiller" writes:
  16.  
  17. >I am doing an assignment for my computing class, and seem to have run into 
  18. >a small problem. I am supposed to be able to read an unlimited string from 
  19. >stdin, without defining maximum size. I thought that this problem would be 
  20. >simple....but I have been at it for a while now. Ill show you what my last 
  21. >resort was.....
  22.  
  23. Check up on the realloc() standard library function. It allows you to change
  24. the size of a malloc'd object while preserving the data in it (as far as
  25. possible if you make it smaller).
  26.  
  27. -- 
  28. -----------------------------------------
  29. Lawrence Kirby | fred@genesis.demon.co.uk
  30. Wilts, England | 70734.126@compuserve.com
  31. -----------------------------------------
  32.